#include "StdAfx.h"
#include "TestWin.h"

CTestWin::CTestWin(void)
{
}


CTestWin::~CTestWin(void)
{
}

bool CTestWin::PreCreate(CREATESTRUCT& cs)
{
	cs.cx = 800;
	cs.cy = 600;

	RECT rc = {0, 0, 800, 600};
	AdjustWindowRectEx(&rc, cs.style, (GetMenu(m_hWnd) != NULL) ? TRUE : FALSE, cs.dwExStyle);

	cs.cx = -rc.left + rc.right;
	cs.cy = -rc.top + rc.bottom;

	return true;
}

bool CTestWin::OnCreate(CREATESTRUCT* cs)
{
	return true;
}

void CTestWin::OnPaint()
{
	PAINTSTRUCT ps;
	HDC dc = BeginPaint(m_hWnd, &ps);
	{
		MoveToEx(dc, 0, 0, NULL);
		LineTo(dc, 800, 600);
	}
	EndPaint(m_hWnd, &ps);
}

bool CTestWin::OnIdle(ULONG ulCount)
{
	return false;
}
